cmake_minimum_required(VERSION 2.8.3)
project(smartgo_api_ros)
set(CMAKE_BUILD_TYPE Release)
add_compile_options(-std=c++11)
find_package(catkin REQUIRED COMPONENTS
  sensor_msgs
  roscpp
  rospy
  tf
  std_msgs
  common_msg
  nav_msgs
  actionlib_msgs
  actionlib

)
find_package(Bullet REQUIRED)
find_package(SDL REQUIRED)
find_package(SDL_image REQUIRED)

find_package(Boost 1.58.0 COMPONENTS system thread REQUIRED)
find_package(PkgConfig REQUIRED)

pkg_check_modules(YAMLCPP yaml-cpp REQUIRED)
if(YAMLCPP_VERSION VERSION_GREATER "0.5.0")
    add_definitions(-DHAVE_YAMLCPP_GT_0_5_0)
endif()

catkin_package(
  INCLUDE_DIRS include
  CATKIN_DEPENDS roscpp rospy std_msgs common_msg
)

include_directories(
  include 
  ${catkin_INCLUDE_DIRS}
  ${YAMLCPP_INCLUDE_DIRS}
  ${Boost_INCLUDE_DIR}
#  ${PCL_INCLUDE_DIRS}
)
file(GLOB_RECURSE cpp_list_cpp src/*.cpp)
add_executable(smartgo_api_ros ${cpp_list_cpp})

target_link_libraries(smartgo_api_ros
  ${catkin_LIBRARIES} 
  ${YAMLCPP_LIBRARIES}
  ${PCL_LIBRARIES}
  ${Boost_LIBRARIES}
  /usr/lib/x86_64-linux-gnu/libglog.so 
  /usr/lib/x86_64-linux-gnu/libevent.so
  ${BULLET_LIBRARIES}
  ${SDL_LIBRARY}
  ${SDL_IMAGE_LIBRARIES}
)

install(TARGETS smartgo_api_ros
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)

install(DIRECTORY launch/
    DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch)
